/*
 * Copyright 2012 ITC Tsinghua University. All Rights Reserved.
 */
package cn.edu.tsinghua.cic.ccss.bo;

import java.util.List;

import javax.mail.internet.AddressException;

import org.forten.core.qo.QueryObject;
import org.forten.core.ro.DtoResultWithPageInfo;

import cn.edu.tsinghua.cic.ccss.dto.CourseDto;
import cn.edu.tsinghua.cic.ccss.dto.CourseDto4Export;
import cn.edu.tsinghua.cic.ccss.dto.CourseDto4Import;
import cn.edu.tsinghua.cic.ccss.dto.CourseDto4Save;
import cn.edu.tsinghua.cic.ccss.dto.SendMessageToCadreDto;
import cn.edu.tsinghua.cic.ccss.qo.CourseQo;

/**
 * 
 * 
 * @author <a href="mailto:du_yi@bbn.cn">Duyi</a>
 * 
 * @since 2012-5-10
 */
public interface CourseBo {
	CourseDto loadCourseDto(Long id);

	Long doSave(CourseDto4Save dto);

	void doUpdate(CourseDto dto);

	List<String> doBatchImport(List<CourseDto4Import> dtoList);

	<Q extends QueryObject> DtoResultWithPageInfo<CourseDto> queryCourseDtoPage(
			Q qo, int page, String fieldName, boolean isAsc);

	// DtoResultWithPageInfo<CourseDto> queryCourseDtoPage(CourseQo qo, int
	// page,String fieldName,boolean isAsc);
	//
	// DtoResultWithPageInfo<CourseDto>
	// queryCourseDtoPage4Selection(CourseSelectAdminQo qo, int page,String
	// fieldName,boolean isAsc);
	//
	// DtoResultWithPageInfo<CourseDto>
	// queryCourseDtoPage4Selection(CourseSelectCadreQo qo, int page,String
	// fieldName,boolean isAsc);
	//
	// DtoResultWithPageInfo<CourseDto> queryCourseDto4Selection(
	// CourseQo4Selection qo, int pageNo,String type);

	List<CourseDto4Export> export(CourseQo qo);

	void doDelete(Long id);

	void doDeleteCourseware(long courseId);

	List<SendMessageToCadreDto> querySendMailToCadreDto();

	String getMailMessageToCadre(Long courseId) throws AddressException;

	void sendMail(Long courseId, String msg);

	List<SendMessageToCadreDto> querySendShortMessageToCadreDto();

	String getShortMessageToCadre(Long courseId);
	
	String getCheckinShortMsgToCadre(Long courseId) throws AddressException;
	/**
	 * 发送上课信息短信
	 * */
	void sendShortMessage(Long courseId, String msg);
	
	/**
	 * 发送考勤短信
	 * @param id 干部id
	 * @param courseId 课程Id
	 * 
	 * */
	void sendCheckInShortMsg(long courseId,Long[] cadreIds, String msg);
	
	/**
	 * 处理考勤回复短信
	 * @param phoneNum 手机号码 重要
	 * @param content 短信内容重要
	 * */
	void handleReceiptedShortMsg(String phoneNum,String content);
	
	/**
	 * 删除考勤短信
	 * */
	void doDeleteShortMsgOfCheckIn(Long[] id);
	
}
